package net.cnki.sunny.model.dto;

import lombok.Data;
import net.cnki.sunny.common.QueryDTO;
import net.cnki.sunny.validate.BeanValidation;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

@Data
public class UserDTO extends QueryDTO {

    @NotNull(message = "id不能为空", groups = BeanValidation.ThirdGroup.class)
    private Integer id;
    @NotNull(message = "用户名不能为空", groups = {BeanValidation.FirstGroup.class, BeanValidation.SecondGroup.class, BeanValidation.ThirdGroup.class})
    private String username;
    @NotNull(message = "密码不能为空", groups = BeanValidation.FirstGroup.class)
    private String password;
    @Length(max = 50, message = "邮箱不能超过50个字符", groups = {BeanValidation.FirstGroup.class, BeanValidation.SecondGroup.class, BeanValidation.ThirdGroup.class})
    private String email;
    private String keywords;
}
